<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\SemiFinishProductRep;
use Illuminate\Http\Request;

class SemiFinishProduct extends Controller
{
    //半成品管理
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new SemiFinishProductRep();
    }

    /**
     * 获取列表
     * @param Request $request
     */
    public function getSemiFinishProductList(Request $request){
        $params = $request->all();
        $data = $this->rep->getSemiFinishProductListRep($params);
        return re(0,$data,'success');
    }


    /**
     * 半成品加入成品库
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function addFinishProduct(Request $request){
        $params = $request->all();
        $data = $this->rep->addFinishProductRep($params);
        return re($data['code'],'',$data['msg']);
    }

}
